             package com.java.diagnostics.visualizer.recommender.switchToBalanced;
             
             import com.java.diagnostics.visualizer.data.AggregateData;
             import com.java.diagnostics.visualizer.data.DataPoint;
             import com.java.diagnostics.visualizer.data.StructuredData;
             import com.java.diagnostics.visualizer.data.TupleData;
             import com.java.diagnostics.visualizer.recommender.Recommendation;
             import com.java.diagnostics.visualizer.recommender.RecommendationBase;
             import com.java.diagnostics.visualizer.recommender.util.RecommendationLabels;
             import java.text.MessageFormat;
             import java.util.Map;
             
             public class LookForLargeAllocations
               extends RecommendationBase
               implements Recommendation
             {
               public void recommend(AggregateData data)
               {
                 if (is26VM(data)) {
                   TupleData bytesRequested = data
                     .getTupleData("VGCLabels.request.sizes.which.triggered.failures");
                   
                   StructuredData attributes = data
                     .getStructuredData("VGCLabels.gc.attributes");
                   
                   if (attributes != null) {
                     String maxHeap = (String)attributes.getContents().get(
                       "maxHeapSize");
                     if (maxHeap != null) {
                       Long maxHeapValue = 
                         Long.valueOf(Long.parseLong(maxHeap.substring(2), 16));
                       
                       if (bytesRequested != null) {
                         DataPoint[] bytesRequestedPoints = bytesRequested
                           .getDataPoints();
                         
                         double largeAllocations = 0.0D;
                         for (DataPoint pause : bytesRequestedPoints) {
                           if (pause.getRawY() > maxHeapValue.longValue() / 2048.0D) {
                             largeAllocations += 1.0D;
                           }
                         }
                         if (largeAllocations > 0.05D * bytesRequested.length()) {
                           long percent = Math.round(largeAllocations / 
                             bytesRequested.length() * 100.0D);
                           addWarning(
                             data, 
                             
                             MessageFormat.format(
                             RecommendationLabels.LARGE_ALLOCATIONS_WARNING, 
                             new Object[] { Long.valueOf(percent) }));
                         }
                       }
                     }
                   }
                 }
               }
             }


